<script setup>
import { ScenicAreaSearchService } from '@/api/scenicArea'
import { ref } from 'vue'
defineProps({
  modelValue: {
    type: Array
  },
  width: {
    type: String
  }
})
const emit = defineEmits(['update:modelValue'])
//子组件通知父组件
const alongScenicAreaChannel = ref([])
const getTagChannel = async () => {
  const res = await ScenicAreaSearchService()
  alongScenicAreaChannel.value = res.data.data.records
}

getTagChannel()
</script>
<template>
  <el-select
    multiple
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    style="width: 900px; max-width: 1000px; height: 40px"
    :style="{ width }"
  >
    <!-- 子传父 -->
    <el-option
      v-for="Channel in alongScenicAreaChannel"
      :key="Channel.id"
      :label="Channel.scenicAreaName"
      :value="Channel.id"
    ></el-option>
  </el-select>
</template>
<style lang="scss" scoped></style>
